package zxw.utils;

import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DataConverter implements Converter<String,Date> {

    @Override
    public Date convert(String source) {
        SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");
        Date format=null;
        try {
            format = dateFormat.parse(source);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return format;
    }
}
